package com.winit.schedule.core.repository;

import java.util.List;

import com.winit.schedule.core.repository.entity.TaskTrackerEntity;
import com.winit.schedule.core.repository.query.TaskTrackerQuery;

public interface TaskTrackerRepository {

    TaskTrackerEntity saveTaskTracker(TaskTrackerEntity entity);

    TaskTrackerEntity updateHeartbeatTime(TaskTrackerEntity entity);

    void removeTaskTracker(String uuid);

    TaskTrackerEntity getTaskTrackerByUuId(String uuid);

    List<TaskTrackerEntity> findTaskTrackerPage(TaskTrackerQuery query);

    List<TaskTrackerEntity> removeTaskTrackerForTimeout(long timeout);

    List<TaskTrackerEntity> findTaskTrackerByTask(String taskGroup, String taskName);

    /**
     * 根据任务ID查询活动的TaskTracker数量
     * 
     * @param taskId
     * @return
     */
    long queryTaskTackerNumberByTaskId(String taskId);
}
